package com.geeker.common.exception;

import cn.hutool.core.util.StrUtil;
import com.geeker.common.api.ResultCode;

public class BusinessException extends RuntimeException {

    private long code = ResultCode.FAILED.getCode();

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(CharSequence template, Object... params) {
        super(StrUtil.format(template, params));
    }

    public BusinessException(long code, String message) {
        super(message);
        this.code = code;
    }

    public long getCode() {
        return this.code;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }
}
